<template>
  <div class="job_detail">
    <van-sticky>
      <van-nav-bar title="人才招聘" left-arrow @click-left="back" />
    </van-sticky>
    <div class="job">
      <div class="list van-hairline--bottom">
        <div class="left">
          <h4 class="name">{{detail.jobName}}</h4>
          <div class="tags flex">
            <span class="tag">{{detail.workingLifeCN}}</span>
            <span class="tag">{{detail.degreeCN}}</span>
          </div>
        </div>
        <div class="price">{{detail.salaryTypeCN}}</div>
      </div>
      <h5 class="title">职位描述</h5>
      <p class="content" v-html="detail.jobDescription"></p>
    </div>
    <router-link tag="div" :to="{path:`/join/${$route.params.id}`}" class="btn">立即应聘</router-link>
  </div>
</template>

<script>
import api from 'api/api'
export default {
  data () {
    return {
      detail: {}
    }
  },
  created () {
    this.getData()
  },
  methods: {
    getData () {
      api.jobInfor({
        data: {
          id: this.$route.params.id
        }
      }).then(res => {
        this.detail = res.data
      })
    },
    back () {
      window.history.go(-1)
	  // this.$router.push('/company/'+1)
    }
  }
}
</script>

<style lang="scss">
.job_detail {
  .job {
    text-align: left;
    padding: 0.3rem;
    background-color: #fff;
    .list {
      display: flex;
      justify-content: space-between;
      padding: 0.4rem 0;
      .left {
        .name {
          font-size: 0.32rem;
          margin-bottom: 0.2rem;
        }
        .tag {
          padding: 0.02rem 0.2rem;
          border-radius: 0.07rem;
          background-color: #f3f4f5;
          color: #666;
          font-size: 0.22rem;
          margin-right: 0.2rem;
        }
      }
      .price {
        font-size: 0.32rem;
        color: #ff344c;
      }
    }
    .title {
      font-size: 0.32rem;
    }
    .content {
      font-size: 0.3rem;
      color: #333;
      margin-top: 0.2rem;
    }
  }
  .btn {
    width: 100%;
    line-height: 0.98rem;
    position: fixed;
    bottom: 0;
    left: 0;
    background: linear-gradient(
      96deg,
      rgba(72, 143, 240, 1),
      rgba(51, 130, 239, 1)
    );
    font-size: 0.36rem;
    color: #fff;
  }
}
</style>